Open
Conversation
implented some small speedups
still inexplicably have an order-of-magnitude speed difference between calling `parse_newick` on a newick string and doing the _exact same thing_ within the io code...
e-koch
requested changes
Dec 7, 2021
Contributor
e-koch
left a comment
There was a problem hiding this comment.
I added a few minor comments. Some of the test failures are legitimate and at least one seems to be related to this PR (https://travis-ci.org/github/dendrograms/astrodendro/jobs/523668907#L1286).
| self._smallest_index = min(self._indices) | ||
| try: | ||
| self._smallest_index = min(self._indices) | ||
| except ValueError: |
Contributor
There was a problem hiding this comment.
What causes the ValueError in min? Is there a check somewhere if _indices is empty?
parse_newick right now)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a WIP to speed up the reading and parsing of dendrograms from disk.
One key change in speeding up the parsing was removing a conversion from an array of coordinates to a list of tuples of coordinates. Creating N tuples was a very expensive step, apparently, and eliminating it cut the time by >50% in the
_fast_reader.The WIP is (1) to make sure that we didn't break anything, really and (2) to try to speed up
parse_newick.